Head-of-queue blocking for multiple lossless queues

ABSTRACT

A network element includes a transmit-queue for transmitting packets from at least two sources, each source having a predefined priority level, to a headroom buffer in a peer network element. Flow-control circuitry receives from the peer network element signaling that indicates a number of credits for transmitting packets to the peer network element, manages a current number of credits available for transmission from the transmit-queue, responsive to the signaling, selects a threshold priority based on the current number of credits for the transmit-queue; and transmits packets associated with data sources of the transmit-queue that are higher in priority than the threshold priority, and refrain from transmitting other packets associated with the transmit-queue.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of U.S. patent application Ser. No. 16/783,184, filed Feb. 6, 2020, which is incorporated herein by reference.

BACKGROUND OF THE INVENTION

Communication systems, and, particularly, data center networks, must handle large volume of data traffic with a low rate of lost datagrams. The Institute of Electrical and Electronics Engineers (IEEE) 802 Nendica report titled “The Lossless Network for Data Centers,” 2018 summarizes trends and issues in lossless data center networks, discusses the need for new technologies to combat loss and introduces potential solutions. A shorter version can be found in: “The Lossless Network for Data Centers,” Huawei Technologies Co., Ltd., Baidu, Inc., Revision 1.0, Nov. 1, 2017.

SUMMARY OF THE INVENTION

An embodiment of the present invention that is described herein provides a network element including at least one headroom buffer, and flow-control circuitry. The headroom buffer is configured for receiving and storing packets from a peer network element having at least two data sources, each headroom buffer serving multiple packets. The flow-control circuitry is configured to quantify a congestion severity measure, and, in response to detecting a congestion in the headroom buffer, to send to the peer network element pause-request signaling that instructs the peer network element to stop transmitting packets that (i) are associated with the congested headroom buffer and (ii) have priorities that are selected based on the congestion severity measure.

In some embodiments, the headroom buffer is configured to receive packets from at least two queues in the peer network element, at least one of the queues having at least two data sources, to store packets from the queues in different locations, and to quantify congestion severity measures separately for each of the queues. In an example embodiment, the headroom buffer includes a plurality of buffers, each buffer configured to store packets from a corresponding queue in the peer network element.

There is additionally provided, in accordance with an embodiment of the present invention, a network element including at least one transmit-queue, and flow-control circuitry. The transmit-queue is configured for transmitting packets from at least two sources, each source having a predefined priority level, to a headroom buffer of a peer network element. The flow-control circuitry is configured to receive from the peer network element pause-request signaling that specifies a congestion severity measure, and, responsive to the pause-request signaling, select a threshold priority based on the congestion severity measure, and stop transmitting packets that (i) are associated with the data sources of the queue and (ii) have priorities that are lower than the threshold priority.

In an embodiment, the network element includes at least two transmit queues, at least one of the transmit queues having at least two sources.

There is also provided, in accordance with an embodiment of the present invention, a network element including at least one transmit-queue, and flow-control circuitry. The transmit-queue is configured for transmitting packets from at least two sources, each source having a predefined priority level, to a headroom buffer in a peer network element. The flow-control circuitry is configured to receive from the peer network element signaling that indicates a number of credits for transmitting packets to the peer network element, and, responsive to the signaling, select a threshold priority based on the number of credits indicated in the signaling, transmit packets associated with data sources of the queue that are higher in priority than the threshold priority, and refrain from transmitting other packets associated with the queue.

In an embodiment, the network element includes at least two transmit queues, at least one of the transmit queues having at least two sources.

There is further provided, in accordance with an embodiment of the present invention, a method for communication, including, in a network element, receiving and storing in at least one headroom buffer packets from a peer network element having at least two data sources, each headroom buffer serving multiple packets. A congestion severity measure is quantified. In response to detecting a congestion in the headroom buffer, pause-request signaling is sent to the peer network element. The pause-request signaling instructs the peer network element to stop transmitting packets that (i) are associated with the congested headroom buffer and (ii) have priorities that are selected based on the congestion severity measure.

In some embodiments, receiving the packets includes receiving in the headroom buffer packets from at least two queues in the peer network element, at least one of the queues having at least two data sources, storing the packets includes storing the packets from the queues in different locations, and quantifying the congestion severity measure includes quantifying congestion severity measures separately for each of the queues. In an embodiment, the headroom buffer includes a plurality of buffers, and storing the packets includes storing in each buffer packets from a corresponding queue in the peer network element.

There is additionally provided, in accordance with an embodiment of the present invention, a method for communication, including, using at least one transmit-queue in a network element, transmitting packets from at least two sources, each source having a predefined priority level, to a headroom buffer of a peer network element. Pause-request signaling, which specifies a congestion severity measure, is received from the peer network element. Responsive to the pause-request signaling, a threshold priority is selected based on the congestion severity measure, and transmission of packets that (i) are associated with the data sources of the queue and (ii) have priorities that are lower than the threshold priority, is stopped.

There is also provided, in accordance with an embodiment of the present invention, a method for communication, including, using at least one transmit-queue in a network element, transmitting packets from at least two sources to a headroom buffer in a peer network element, each source having a predefined priority level. Signaling, which indicates a number of credits for transmitting packets to the peer network element, is received from the peer network element. Responsive to the signaling, a threshold priority is selected based on the number of credits indicated in the signaling, packets associated with data sources of the queue that are higher in priority than the threshold priority are transmitted, and other packets associated with the queue are refrained from transmission.

The present invention will be more fully understood from the following detailed description of the embodiments thereof, taken together with the drawings in which:

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram that schematically illustrates lossless data transfer between two network elements, in accordance with an embodiment of the present invention;

FIG. 2 is a timing diagram that schematically illustrates credits-based data transfer along a horizontal Time axis, in accordance with an embodiment of the present invention;

FIG. 3 is a flowchart that schematically illustrates a method for supporting sub-priorities in a credits-based system, in accordance with embodiments of the present invention;

FIG. 4 is a block diagram that schematically illustrates a Transmit-Queue in a credit-based system, in accordance with an embodiment of the present invention; and

FIG. 5 is a block diagram that schematically illustrates pause-based data transfer between two network elements, in accordance with an embodiment of the present invention.

DETAILED DESCRIPTION OF EMBODIMENTS Overview

Modern data centers typically handle massive amounts of data that are generated and forwarded by highly parallel applications, such as Artificial Intelligence (AI) applications, which historically required specialized High-Performance Computing (HPC) infrastructure. Using high-speed distributed solid-state storage, coupled with remote direct memory access (RDMA) and modern networking congestion management techniques, the applications may run atop more generalized next generation cloud infrastructure.

According to the IEEE 802 Nendica Report cited above, “the key to advancing cloud infrastructure to the next level is the elimination of loss in the network, not just packet loss, but throughput loss and latency loss.” Lossless traffic is the egress-port ability to send a packet across media, knowing that the packet will have buffer space in the receiving ingress-port.

As the sorting and forwarding of ingress packets at the ingress port may take some time (e.g., when the destination of the packet is not ready to receive the packet), the ingress port assigns a buffer (referred to as Headroom Buffer hereinbelow) to store packets that are received from the remote egress-port. The buffer is emptied when data packets that are stored in the buffer are forwarded to destinations (or pulled by the destinations) and filled when new packets are received from the peer egress port. If the rate at which data packets are forwarded to destinations (buffer emptying rate) is lower than the rate at which new data packets are written into the buffer (buffer fill-rate), the buffer may fill up, and new packets may be lost. This phenomenon is sometimes called “queue overflow data-loss”.

To reduce the risk of queue overflow data loss, a duplex connection with a suitable flow-control scheme may be established between the egress port and the ingress port. When the headroom buffer is congested (e.g., the free size in the buffer is smaller than a preset threshold), the ingress port sends congestion notification packets to the egress port, responsive to which the egress port lowers the rate of data packet transmissions.

Two flow-control methods using congestion-notifications packets are commonly used—Credits-Based and Pause-Based. According to the credit-based method, the receiver, upon initialization, grants the transmitter data-sending credits corresponding to the available space in the headroom buffer, for example, in units of 128 bytes. The sender uses the credits to send data, and the receiver sends new credits when old data packets are read from the headroom buffer.

In contrast, according to the pause-based method, the receiver sends a Pause request (which may be embedded in other flow-control packets, or sent as a separate packet) when the headroom buffer is congested, and the transmitter, when receiving a pause request, stops sending packets for a period of time which may be predefined, changing dynamically or, for example, indicated in the pause request (the transmitter may also resume sending packets when receiving a “resume” request from the receiver).

The single buffer solution described above does not work well when flows of packets sent from the egress port to the ingress port with several varying priority service classes are supported. If a packet associated with a low priority service is stuck, e.g., when the destination is not free to receive the packet, all subsequent packets, including packets with higher service class, will have to wait. This phenomenon is sometimes called Head-Of-Queue Blocking.

To mitigate head-of-queue blocking, the headroom buffer may be partitioned into two or more separate smaller buffers, which are sometimes called, in Infiniband™ nomenclature, Virtual Lanes (VL) and, in Ethernet nomenclature, IEEE-priority. The partition into separate buffers allows independent packet communication in a plurality of parallel channels from a transmitter to a receiver and mitigates head-of-queue blocking. Moreover, the partition allows prioritizing according to service classes, wherein a higher priority service class may be assigned a larger buffer, as well as higher communication and processing priority.

However, in both the VL and the IEEE priority schemes, the number of concurrent streams is limited to eight; and, as the number of priority levels may be substantially more than eight, a plurality of packets of varying priorities needs to share the same VL or IEEE priority level.

Embodiments according to the present invention that are described herein provide systems and methods for improved lossless communication when a plurality of flows with varying priorities share the same VL or IEEE priority (and, hence, much more than eight priority levels may be supported with the eight-priority VL or IEEE-priority schemes). (To avoid confusion with the inter-queue priorities, we will refer to the priorities within each queue as sub-priorities.)

In the description hereinbelow, we will refer to the network element that sends data packets as Data Transmitting Network Element (DTNE), and to the network element that receives data packets as Data Receiving Network Element (DRNE). As would be appreciated, a network element may function as a DTNE in some ports and as a DRNE in other ports. Additionally or alternatively, ports of the network element that send data packets, may be reconfigured to ports that receive data packets, and vice-versa.

According to an embodiment, a DTNE is configured to receive credits from a DRNE. The DRNE comprises a headroom buffer which is divided into eight (or less) separate buffers, associated with respective peer queues in a peer DTNE. The DRNE sends credit allocation packets to the DTNE responsive to removal of the data from the buffers, expecting the peer DTNE to send packets only if the DTNE has enough credits (separately for each queue).

The DTNE is configured to send data separately to each of the separate buffers of the headroom buffer of the DRNE, and to receive credit allocation packets from the DRNE. The DTNE may comprise a plurality of data sources with varying sub-priorities for each of the DRNE buffers (in some embodiments, the DTNE further comprises transmit queues, which temporarily store the packets). The DTNE is further configured to send, for each of the buffers, data from sources with a sub-priority greater than a threshold, wherein a Flow Control Circuitry within the DTNE sets the threshold, responsive to the number of available credits for the queue.

Thus, in a credit-based system according to embodiments of the present invention, a DTNE can control the sub-priority of the sources for each of the DTNE buffers, and, whereas a stalled high sub-priority source can still block transfer of data packets, a low sub-priority source cannot block sources with higher sub-priorities.

According to another embodiment of the present invention, a DRNE comprises a Flow Control Circuitry, which calculates a congestion-severity measure for each of the buffers in the headroom buffer (the congestion-severity measure may be, for example, the occupancy of the buffer). Responsive to the congestion-severity measure, the DRNE may send pause request packets with sub-priority indication to a peer DTNE. The peer DTRE comprises a plurality of data sources with varying sub-priorities, and is configured to receive the pause request packets from the DRNE, and to pause sending packets from sources having sub-priorities lower than the sub-priority indicated in the pause-request packets. Thus, low-severity congestions in a DRNE queue will pause low-sub-priority sources only, and high priority sources will pause only when the congestion is severe.

System Description

FIG. 1 is a block diagram 100 that schematically describes lossless data transfer between two network elements, in accordance with an embodiment of the present invention.

A Data-Transmitting Network Element (DTNE) 102 comprises N Transmit Queues 104, which are coupled to N Receive Buffers 106 in a Data Receiving Network Element (DRNE) 108, through N duplex links 110 (Although DTNE 102 and DRNE 108 are network elements in the sense that they are configured to send and receive packets from the network, lossless data transfer is often associated with data centers and the connection between DTNE 102 and DRNE 108 typically comprises direct point to point connections rather than communication through a network).

The data path comprising a transmit queue 104, a duplex link 110 and a receive queue 106 will be referred to herein as Virtual-Lane (VL), and, although VL is commonly used in Infiniband nomenclature, the present invention is not limited to Infiniband and alternative embodiments may use IEEE priorities, or any other suitable link virtualization technique.

As would be appreciated, duplex links 110 are not necessarily separate physical links; rather, in embodiments, duplex links 110 are logical links, which may share the same physical link (or physical links).

Data sources within the DTNE transmit flows of data packets that may have varying service classes and, accordingly, variable priorities. The division of the communication to VLs allows eight levels of priority, and the DTNE assigns the data sources to transmit queues accordingly.

However, in many applications, N (which is typically limited to 8) is not enough, as many more priorities are needed. In the example embodiment illustrated in FIG. 1 , a plurality of data sources with varying priorities is input to each Transmit Queue. The priorities of the data sources that are input to each transmit queue 104 will be referred to herein as sub-priorities, which are hierarchically below the priorities of the VLs and the corresponding transmit queues. The combined priority scheme is defined as follows—if A>B, all data sources that are input to a transmit queue A have higher priority than data sources that are input to a transmit queue B. Within the same transmit queue, priority order is according to the sub-priorities of the inputs to the transmit queue.

In embodiments according to the present invention, the DTNE and/or the DRNE comprise flow-control circuitry (not shown), that prioritizes the transmission of packets in each VL according to the sub-priorities that are assigned to the data sources input to the transmit queue.

Thus, according to the example embodiment illustrated in FIG. 1 , a limited number of Virtual Lanes may support a higher number of priorities (and, hence, service classes). In each VL, a stalled low-priority data packet cannot block higher priority data packets.

As would be appreciated, the configuration of lossless data network 100, including DTNE 102, DRNE 108 and Duplex Links 110 is an example configuration that is depicted purely for the sake of conceptual clarity. Other suitable configurations may be used in alternative embodiments of the present invention. For example, in some embodiments some of duplex links 110 may share a common physical connection; in other embodiments some or all the control packets that the DRNE sends to the DTNE may be concatenated in a smaller number of packets, or in a single packet. In an embodiment, data is transferred within units of the same system, which may be a High-Performance Computing (HPC) system; in this embodiment data may be transferred through high performance busses.

Credit-Based Method

According to some embodiments of the present invention, a DRNE sends credits to a peer DTNE when the amount of free storage space in the receive buffer is more than a predefined threshold. According to an embodiment, the DTNE is granted with an initial amount of credits when the receive queue is empty (e.g., upon initialization), and stores it in a credits-accumulator. The DTNE decrements the credits-accumulator when sending data and increments the credits-accumulator when receiving new credits from the DRNE. In some embodiments, each credit represents a fixed buffer size; e.g., 128 bytes).

In an embodiment, the DTNE is configured to receive data from a plurality of sources for each of the Transmit Queues, wherein a different sub-priority level is allocated to each data source. The DTNE may transfer data to the DRNE, separately for each Transmit Queue, responsive to the priority of the data sources and the amount of credits in the credits-accumulator.

FIG. 2 is a timing diagram 200 that schematically describes credits-based data transfer along a horizontal Time axis 202, in accordance with an embodiment of the present invention. The top part of the figure illustrates the credits status and thresholds in the DTNE, whereas the bottom part describes activities in the DRNE.

The example embodiment illustrated in FIG. 2 refers to flows that are routed to a single receive buffer 106 (FIG. 1 ). There are two flows having two sub-priorities in the example embodiment illustrated in FIG. 2 —a lower sub-priority Flow A 204, and a higher sub-priority flow B 206. For each of the two flows, write events, read events and partial occupancy of the Receive Buffer, are shown. An event, in this example embodiment, corresponds to the transfer of a block of data equal in size to one credit (e.g., 1 Mbyte), which will be referred to herein as Data Unit.

The timing diagram starts at a steady state, in which the receive buffer is assumed to be almost empty, and whenever the Receive Buffer receives a data packet, the DRNE immediately sends the data from the Receive Buffer to a Flow-A or a Flow-B destination, and, sends a credit to the DTRE. The occupancies of Flow A and Flow B within the Receive Buffer, therefore, oscillate between 1 and 0 units.

A Send-Credit graph 208 illustrates the credits that the DRNE sends to the DTNE, triggered by the sending of data from the Receive Buffer (to a Flow-A or a Flow-B destination), and a Credits graph 210 illustrates the number of credits in the DTNE.

At a time-point 212 the DRNE stops sending Flow-A data from the Receive Buffer. This may happen, for example, if the DRNE hardware cannot find routing rules in its local memory and needs to “ask” the processor to calculate the routing. As no Flow-A data is read from the Receive Buffer, Flow A's occupancy in the Receive Buffer will start to grow. Flow B's occupancy will continue to oscillate between 1 and 0.

The frequency of the Send Credits events will decrease by 50%, and the credits count in the credits accumulator will start to decline, as for every two unit-decrements (one for Flow A and one for Flow B), the DTNE will receive only one credit.

According to the example embodiment illustrated in FIG. 2 , the DTNE is configured to compare the number of credits in the credits-accumulator to two thresholds—a Threshold TH[0] 216 and a threshold TH[1] 218. If the number of credits is not higher than TH[0], the DTNE will stop sending the lower priority Flow-A data packets to the Receive Buffer, but will continue to send the higher priority Flow-B data packets. If the number of credits is not higher than TH[1], the DTNE will stop sending all packets.

At a time-point 214 the number of credits in the DTNE reaches TH[0]. The DTNE stops sending Flow A data packets, but continues to send Flow B data packets. The communication is now balanced, and the number of credits remains close to TH[0]. Flow B is still protected from overflow, and, if the credit count will decrease to TH[1], the DTNE will wait for new credits.

Thus, according to the example embodiment illustrated in FIG. 2 , head-of-queue blocking in a lower sub-priority does not stop transmissions of data packets from a higher sub-priority.

As would be appreciated, timing diagram 200 is a simplified example that is depicted purely for the sake of conceptual clarity. The illustration and the description ignore the delay in the communication link and assume stable read and write rates. In practical scenarios, the credits count may widely fluctuate. Data is not always read right after it is written, and the read and write quanta may be different in size than a credit. In alternative embodiments, more than two sub-priorities may be used, each with its own threshold (some of the thresholds may be equal).

FIG. 3 is a flowchart 300 that schematically illustrates a method for supporting sub-priorities in a credits-based system, in accordance with embodiments of the present invention. The method that is illustrated in FIG. 3 supports eight sub-priorities but can be readily modified to any number of sub-priorities. The flowchart is executed by Transmit-Queue 104 (FIG. 1 ).

The flowchart starts at an Updating-Number-Of-Credits step 302, wherein the Transmit-Queue either increments the number of credits in response to credits that the Transmit Queue receives from the DRNE, or decrements the number-of-credits, after sending a data packet to the DRNE.

Next, in a Comparing-First-Threshold step 304, the Transmit Queue compares the number of credits to the lowest threshold TH1, associated with the highest sub-priority. If the number of credits is lower than TH1, the Transmit-Queue will, in a Not-Sending-Packets step 306, stop sending any packets, and then re-enter Updating-Number-Of-Credits step 302. If, in step 304, The number of credits is not lower than TH1, the Transmit Queue will enter a Comparing-Second-Threshold step 308 and compare the number of credits to a second (higher) threshold TH2. If the number of credits is lower than TH2 the Transmit Queue will enter a Sending-Sub-Priorities-Greater-than-7 step 310 and send data packets with the highest sub-priority (8) only, and then re-enter Updating-Number-Of-Credits step 302.

If, in step 308, The number of credits is not lower than TH2, the Transmit Queue will enter a Comparing-Third-Threshold step 312 and compare the number of credits to a third threshold TH3. If the number of credits is lower than TH3 the Transmit Queue will enter a Sending-Sub-Priorities-Greater-than-6 step 314 and send data packets with the two highest sub-priorities (7 and 8) only, and then re-enter Updating-Number-Of-Credits step 302.

The method continues in the same manner for higher thresholds and lower sub-priorities, until the Transmit-Queue enters a Comparing-Eighth-Threshold step 316. If the number of credits is lower than this maximal threshold TH8, the Transmit-Queue will enter a Sending Sub-Priorities-Greater-than-1 step 318 and send all but the lowest priority packets, and then re-enter Updating-Number-Of-Credits step 302. If, in step 316, the number of credits is still not below the highest threshold TH8, the Transmit Queue will send all packets, and then re-enter Updating-Number-Of-Credits step 302.

Thus, according to the example embodiment illustrated in FIG. 3 , the Transmit Queue compares the number of available credits to a list of thresholds and prioritizes between data packets that the Transmit Queue sends to the DRNE accordingly.

As would be appreciated, flowchart 300 is an example flowchart that is depicted purely for the sake of conceptual clarity. Other suitable flowcharts may be used in alternative embodiments of the present invention. For example, the number of sub-priorities may be different from n and/or some sub-priorities may be assigned the same threshold. In an embodiment, some thresholds are predefined (or programmed) and other thresholds may be calculated from the predefined thresholds, using, for example, interpolation.

FIG. 4 is a block diagram that schematically describes a Transmit-Queue 104 (FIG. 1 ) in a credit-based system, in accordance with an embodiment of the present invention. The Transmit Queue receives data with varying sub-priorities from n sources, and comprises n Sub-Queues 402, a Selector 404, a Credits Accumulator 406 and a Credits-Based Flow-Control Circuit (CBFCC) 408.

The Transmit Queue stores data packets in sub-queues 402, which indicate the respective queue occupancies to the CBFCC. The Transmit Queue receives control packets from the DRNE. The control packets include credits. In some embodiments, the DRNE sends a single control packet to multiple Transmit Queues, and each Transmit Queue extracts the respective credits; in other embodiments, each Transmit Queue receives a separate control packet from the DRNE.

The credits that the Transmit-Queue receives increment Credit Accumulator 406, which indicates the credits count to CBFCC 408. The CBFCC receives threshold for each of the sub-priorities (the thresholds may be fixed, or dynamically adjusted) and, responsive to the thresholds, the occupancies of the queues and the credit count, indicates to selector 404 to read a data packet from one of sub-queues 402, and to send the packet to the DRNE. The CBFCC is further configured to decrement the credit-count in the Credits Accumulator whenever the CBFCC sends a read indication to the selector.

The selection logic that the CBFCC applies may be, for example:

A—pre-select sub-queues for which the threshold is above the credit-count indicated by the credits-accumulator

B—from the pre-selected sub-queues, select the sub-queue with the highest occupancy.

C—select none if all the pre-selected sub-queues are empty.

Thus, according to the example embodiment illustrated in FIG. 3 , each transmit queue can prioritize multiple data sources, resulting in a credit-based system with more than eight priorities.

As would be appreciated, the configuration of Transmit-Queue 104 is an example configuration that is depicted purely for the sake of conceptual clarity. Other suitable configurations may be used in alternative embodiments of the present invention. For example, data flow order may change, so that a selector will select data packets from one of the sources, and a single Transmit Queue will be used. In some embodiments, the data sources may comprise net data, and the Transmit Queue may incorporate packetizing logic, which adds headers and footers to the data.

The selection logic employed by the CBFCC may vary. For example, from the pre-selected sub-queues, the CBFCC, in some embodiments, will select the sub-queue with the highest priority (if the sub-queue Is not empty). In some embodiments, if all preselected sub-queues are empty, the CBFCC will select a sub-queue with a threshold that is below the credits-count; in some embodiments, the selection logic may change dynamically.

Pause-Based Method

According to some embodiments of the present invention, a DRNE sends Pause requests to the DTNE when the DTRE headroom buffer is occupied beyond a preset limit. To assign sub-priorities, a DRNE in accordance with the present invention compares the occupancy of the headroom buffer to a set of thresholds, and then sends to the DTNE a Pause request with sub-priority indication. The DTNE can then stop sources according to the sub-priority indicated in the pause request.

FIG. 5 is a block diagram 500 that schematically describes Pause-based data transfer between two network elements, in accordance with an embodiment of the present invention. A DTNE 102 (FIG. 1 ) comprises up to eight Transmit Queues 104 that send data packets to a DRNE 108. The DRNE comprises Receive Buffers 502, one for each Transmit Queue 104.

Each Receive Buffer 502 comprises a Headroom Buffer 504 that stores data packets that the corresponding Transmit Queue sends. A Comparator 506 compares the headroom buffer occupancy to a set of thresholds, one for every sub-priority, and a Pause-Message-Encoder 506 converts the comparison result to control packets that signal prioritized pause requests (or, if the headroom buffer occupancy is lower than the first threshold, no Pause request message will be signaled). For example, the comparator may indicate that the headroom buffer occupancy is between threshold n and threshold n+1 from an ascending group of m thresholds, and, responsive to this indication, the Pause Message Encoder may build a packet that comprises a Pause Message that indicates to the corresponding Transmit Queue that messages from sub-priorities lower then n should be Paused (for the sake of generalization, the control packet will be sometimes referred to as pause-request signaling).

As would be appreciated, high headroom buffer occupancy may indicate congestion, which grows in severity as the occupancy reaches the buffer capacity. The occupancy is sometimes referred to as congestion-severity measure. By comparing the congestion severity to thresholds, comparator 506 determines which sub-priorities the Transmit Queue should pause.

Each Transmit Queue 104 comprises a plurality of Sub-Queues 510, which temporarily store data from external sources with varying sub-priorities; a Selector 512, which reads data packets from the Sub-Queues and forwards the data packets to the DRNE; and, a Pause-Based-Flow-Control-Circuit (PBFCC) 514.

The PBFCC is configured to receive the pause request signaling from the corresponding Receive Buffer and, responsive to the pause requests and to the occupancies of the sub-queues, control the Selector to read a data packet from one of the Sub-Queues and forward the packet to the corresponding Receive Buffer.

The selection logic that the PBFCC applies may be, for example:

A—pre-select sub-queues with sub-priority higher or equal to the sub-priority indicated in the pause request message (if no pause request is received—pre-select all sub-queues);

B—from the pre-selected sub-queues, select the sub-queue with the highest occupancy.

C—select none if all the pre-selected sub-queues are empty.

In summary, according to the example embodiment illustrated in FIG. 5 , a DRNE may generate pause request packets with sub-priority information, responsive to the occupancy of the headroom buffer, for each of the Transmit Queues of the peer DTNE. The DTNE is configured to stop, in response to pause requests, only the indicated sub-priorities.

As would be appreciated, the configurations of Transmit-Queue 104 and Receive Buffer 502 are example configurations that are depicted purely for the sake of conceptual clarity. Other suitable configurations may be used in alternative embodiments of the present invention.

In an alternative embodiment, comparator 506 is not implemented in receive buffer 512, and Pause-Based Message Encoder 508 sends the congestion-severity measure with the pause request signaling. Pause-Based Flow Control Circuitry 514 may then decide which sub-priorities should be paused, based on the congestion-severity measure and on other criteria; e.g., the occupancies of the sub-queues.

In some embodiments, data flow order may change, so that a selector will select data packets from one of the sources, and a single Transmit Queue will be used. In some embodiments, the data sources may comprise net data, and the Transmit Queue may incorporate packetizing logic, which adds headers and footers to create packets.

The selection logic employed by the PBFCC may vary. For example, from the pre-selected sub-queues, the FBFCC, in some embodiments, will select the sub-queue with the highest priority (if the sub-queue Is not empty).

In some embodiments, a unified headroom buffer serves all Receive Buffers 502. In an embodiment, the pause request packet comprises the occupancy of the headroom buffer only, and the Transmit Queue compares the occupancy with thresholds, to determine which sub-queues should be forwarded to the DRNE. In some embodiments some or all the thresholds are fixed, in other embodiments some or all the thresholds may be reprogrammed, in yet other embodiments the transmit queue adjusts some or all the thresholds during run-time, responsive, for example, to congestion statistics.

In the descriptions hereinabove, DTNE 102, DRNE 108 and parts thereof, like Transmit Queue 104 and Receive Buffer 502, have been described in two different manners, one for credit-based transmissions and one for pause-based transmissions. Embodiments according to the present invention include both pause-based and credits-based DTNEs and DRNEs. In some embodiments, DTNEs and/or DRNEs may be configured for both credit-based and pause-based operation, selected by a configuration input or by software control.

In some embodiments, the total number of priorities is less than the maximum (eight) allowed by IEEE or VL, and the disclosed techniques are used to decrease the number of buffers; for example, if eight priority levels are needed, two virtual lanes and two associated transmit and receive buffers may be used, each with four sub-priorities. In some other embodiments, more than eight total priorities are needed and an expanded DL or IEEE architecture (or any other suitable architecture) with more than eight priorities is used; yet only eight (or less) Tx and Rx buffers are implemented, using sub-priorities according to the disclosed techniques.

The configurations of DTNE 102 and DRNE 108 are example configurations that are shown purely for the sake of conceptual clarity. Any other suitable configurations can be used in alternative embodiments. DTNE 102 and/or DRNE 108 may comprise, for example, a communication switch, a router, a server with switching capabilities or aggregation of network elements. The different sub-units of DTNE 102 and DRNE 108 may be implemented using suitable hardware, such as in one or more Application-Specific Integrated Circuits (ASICs) or Field-Programmable Gate Arrays (FPGAs), using software, using hardware, or using a combination of hardware and software elements.

DTNE 102 and/or DRNE 108 may comprise a general-purpose processor, which is programmed in software to carry out the functions described herein. The software may be downloaded to the processor in electronic form, over a network or from a host, for example, or it may, alternatively or additionally, be provided and/or stored on non-transitory tangible media, such as magnetic, optical, or electronic memory.

It will be appreciated that the embodiments described above are cited by way of example, and that the present invention is not limited to what has been particularly shown and described hereinabove. Rather, the scope of the present invention includes both combinations and sub-combinations of the various features described hereinabove, as well as variations and modifications thereof which would occur to persons skilled in the art upon reading the foregoing description and which are not disclosed in the prior art. Documents incorporated by reference in the present patent application are to be considered an integral part of the application except that to the extent any terms are defined in these incorporated documents in a manner that conflicts with the definitions made explicitly or implicitly in the present specification, only the definitions in the present specification should be considered. 

1. A network element, comprising: a transmit-queue for transmitting packets from at least two sources, each source having a predefined priority level, to a headroom buffer in a peer network element; and flow-control circuitry, configured to receive from the peer network element signaling that indicates a number of credits for transmitting packets to the peer network element; manage a current number of credits available for transmission from the transmit-queue, responsive to the signaling; select a threshold priority based on the current number of credits for the transmit-queue; and— transmit packets associated with data sources of the transmit-queue that are higher in priority than the threshold priority, and refrain from transmitting other packets associated with the transmit-queue.
 2. The network element according to claim 1, comprising at least two transmit queues, wherein the flow-control circuitry is configured to perform the acts of receive, manage, select and transmit for each of the at least two transmit queues.
 3. The network element according to claim 2, wherein the flow-control circuitry receives from the peer network element signaling that indicates a separate number of credits for each of the at least two transmit queues.
 4. The network element according to claim 3, wherein the flow-control circuitry receives a single control packet with signaling that indicates the separate number of credits for each of the at least two transmit queues.
 5. The network element according to claim 3, wherein the flow-control circuitry receives the signaling that indicates the separate number of credits for each of the at least two transmit queues in separate control packets for each of the at least two transmit queues.
 6. A method for communication, comprising: using at least one transmit-queue in a network element, transmitting packets from at least two sources to a headroom buffer in a peer network element, each source having a predefined priority level; receiving from the peer network element signaling that indicates a number of credits for transmitting packets to the peer network element; manage for at least one specific one of the at least one transmit-queue, a current number of credits available for transmission from the at least one specific transmit-queue, responsive to the signaling; selecting a threshold priority based on the current number of credits for the at least one specific transmit-queue; and— for the at least specific transmit-queue, transmitting packets associated with data sources of the at least one specific transmit-queue that are higher in priority than the threshold priority, and refraining from transmitting other packets associated with the at least one specific transmit-queue.
 7. A method for communication, comprising: using at least one transmit-queue in a network element, transmitting packets from at least two sources, each source having a predefined priority level, to a headroom buffer of a peer network element; receiving from the peer network element pause-request signaling that specifies a congestion severity measure and a specific transmit-queue; and responsive to the pause-request signaling, selecting a threshold priority based on the congestion severity measure, and stopping transmitting packets that (i) are associated with the data sources of the specific transmit-queue and (ii) have priorities that are lower than the threshold priority, while continuing to transmit packets of the specific transmit-queue with priorities higher than the threshold priority.
 8. The method according to claim 7, wherein the congestion severity measure comprises an occupancy of the headroom buffer. 